//这里开始学java中的字符串

import java.util.Arrays;

public class App {
    public void count() {
        int N = a.length;
        int[] count = new int[R + 1];
        for (int i = 0; i < N; i++)
            count[a[i] + 1]++;
        for (int r = 0; r < R; r++)
            count[r + 1] += count[r];
        for (int i = 0; i < N; i++)
            aux[count[a[i]]++] = a[i];
        for (int i = 0; i < N; i++)
            a[i] = aux[i];
    }

    public class LSD {
        public static void sort(String[] a, int W) {
            int R = 256;
            int N = a.length;
            String[] aux = new String[N];
            for (int d = W - 1; d >= 0; d--) {
                int[] count = new int[R + 1];
                for (int i = 0; i < N; i++)
                    count[a[i].charAt(d) + 1]++;
                for (int r = 0; r < R; r++)
                    count[r + 1] += count[r];
                for (int i = 0; i < N; i++)
                    aux[count[a[i].charAt(d)]++] = a[i];
                for (int i = 0; i < N; i++)
                    a[i] = aux[i];
            }
        }
    }

    private static int charAt(String s, int d) {
        if (d < s.length())
            return s.charAt(d);
        else
            return -1;
    }

    public static void sort(String[] a) {
        aux = new String[a.length];
        sort(a, aux, 0, a.length - 1, 0);
    }

    private static void sort(String[] a, String[] aux, int lo, int hi, int d) {
        if (hi <= lo)
            return;
        int[] count = new int[R + 2];
        for (int i = lo; i <= hi; i++)
            count[charAt(a[i], d) + 2]++;
        for (int r = 0; r < R + 1; r++)
            count[r + 1] += count[r];
        for (int i = lo; i <= hi; i++)
            aux[count[charAt(a[i], d) + 1]++] = a[i];
        for (int i = lo; i <= hi; i++)
            a[i] = aux[i - lo];
        for (int r = 0; r < R; r++)
            sort(a, aux, lo + count[r], lo + count[r + 1] - 1, d + 1);
    }

    public String lrs(String s) {
        int N = s.length();
        String[] suffixes = new String[N];
        for (int i = 0; i < N; i++)
            suffixes[i] = s.substring(i, N);
        Arrays.sort(suffixes);
        String lrs = "";
        for (int i = 0; i < N - 1; i++) {
            int len = lcp(suffixes[i], suffixes[i + 1]);
            if (len > lrs.length())
                lrs = suffixes[i].substring(0, len);
        }
        return lrs;
    }

    public static void main(String[] args) throws Exception {
        System.out.println("Hello, World!");
        StringBuilder a = new StringBuilder();
        String ac = " asd";
        a.length();
        ac.length();
        ac.substring(0, 1);
    }
}
